package com.chen.cloud.micro.consumer.movie.fallback;

import com.chen.cloud.micro.consumer.movie.api.UserFeignClient;
import com.chen.cloud.micro.consumer.movie.dto.User;
import org.springframework.stereotype.Component;

/**
 * @author ChenTian
 * @date 2022/6/7
 */
@Component
public class UserFeignClientFallback implements UserFeignClient {
    @Override
    public User findById(Long id) {
        User user = new User();
        user.setId(-1L);
        user.setUsername("默认用户");
        return user;
    }

    @Override
    public User create(User user) {
        user.setId(-1L);
        return user;
    }
}
